<?php
class Category extends AppModel
{
	public $name = 'Category';

	public $hasAndBelongsToMany = array(
		'Recipe' => array(
			'className' => 'Recipe',
			'joinTable' => 'categories_recipes',
			'foreignKey' => 'category_id',
			'associationForeignKey' => 'recipe_id',
			'unique' => true,
			
			),
		); // end many - many

	public $validate = array(
		'title' =>array(
			'required' => array(
				'rule' => 'notEmpty',
				'message' => 'Your title is required'
				),
			'duplicate' => array(
				'rule' => 'isisUnique',
				'message' => 'Your title already exists'
				),
			),
		); // end validate

}

?>